package com.dcd.service;

import com.dcd.pojo.Car_series;
import org.apache.solr.client.solrj.SolrServerException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.util.List;
import java.util.Map;

@Component
@FeignClient(name = "donchedi-provider9091",  contextId = "carSeries")
public interface Car_seriesService {

    /**
     * 查询历史浏览车系
     *
     * @param car_series_ids 历史浏览车系id数组
     * @return
     */
    @RequestMapping("/select_history_browsing_car_series")
    List<Car_series> select_history_browsing_car_series(@RequestParam String[] car_series_ids);

    /**
     * 查询指定用户收藏车系
     *
     * @param user_id 用户id
     * @return
     */
    @RequestMapping("/select_my_follow_car_series")
    List<Car_series> select_my_follow_car_series(@RequestParam int user_id);

    /**
     * 选车
     *
     * @param conditions 多个条件
     * @return
     */
    @RequestMapping("/vehicle_selection_by_conditions")
    Map<String, Object> vehicle_selection_by_conditions(@RequestParam Map<String, String> conditions);

    /**
     * 查询指定条件车图
     *
     * @param conditions 多个条件
     * @return
     */
    @RequestMapping("/select_all_series_images_by_conditions")
    Map<String, Object> select_all_series_images_by_conditions(@RequestParam Map<String, String> conditions);

    /**
     * 查询指定车系信息
     *
     * @param car_series_id 车系id
     * @return
     */
    @RequestMapping("/select_car_series_by_id")
    Car_series select_car_series_by_id(@RequestParam int car_series_id);

    /**
     * 查询首页头部车系
     *
     * @param different_countries 根据国别查询
     * @param price               //价格
     * @return
     */
    @RequestMapping("/select_index_heand_levei_series")
    Map<String, Object> select_index_heand_levei_series(@RequestParam Integer different_countries, @RequestParam String price);

    /**
     * 查询首页新车
     * @return 返回 名称 时间 最低价格 最高价格 图片 资讯id 资讯标题
     */
    @RequestMapping("/select_index_new_series")
    List<Car_series> select_index_new_series();


    /**
     * 查询同级车排行--5辆
     *
     * @param conditions_type            条件类型（销量/热门度/懂车分）
     * @param car_series_id              车系id
     * @param car_series_car_level_fk_id 该车系级别id
     * @return
     */
    @RequestMapping("/select_same_level_ranking")
    List<Car_series> select_same_level_ranking(@RequestParam String conditions_type, @RequestParam int car_series_id, @RequestParam int car_series_car_level_fk_id);

    /**
     * 查询车系名称 品牌名称
     * @param car_series_id 车系id
     * @return
     */
    @RequestMapping("/select_series_id_brand")
    Car_series select_series_id_brand(@RequestParam Integer car_series_id);

    /**
     * 排行榜分页查询所有(根据销量排行)
     * @param pageRankingIndex   当前页
     * @return map返回数据
     */
    @RequestMapping("/select_sales_all_series")
     Map<String, Object> select_sales_all_series(@RequestParam Integer pageRankingIndex,@RequestParam Integer brand_id,@RequestParam Integer car_level_id,@RequestParam Integer newtime,@RequestParam Integer min_price,@RequestParam Integer max_price);

    /**
     * 查询车系视频推荐排行榜
     * @return
     */
    @RequestMapping("/select_series_video_recommend_ranking")
    List<Car_series> select_series_video_recommend_ranking();

    /**
     * 热销榜(排行榜)
     * @return
     */
    @RequestMapping("/select_hot_ranking")
    public List<Car_series> select_hot_ranking();

    /**
     * 降价榜(排行榜)
     * @return
     */
    @RequestMapping("/select_cut_price_ranking")
    public List<Car_series> select_cut_price_ranking();



    /**
     * 查询指定节目下所有视频的所有车系
     *
     * @param program_id
     * @return
     */
    @RequestMapping("/select_appoint_program_all_car_series")
    List<Car_series> select_appoint_program_all_car_series(@RequestParam int program_id);

    /**
     * 搜索查询车系
     *
     * @param solr_content 搜索文本内容
     * @param page_index   当前页数
     * @return
     */
    @RequestMapping("/select_car_series_by_solr")
    Map<String, Object> select_car_series_by_solr(@RequestParam String solr_content, @RequestParam int page_index) throws IOException, SolrServerException;

    /**
     * 根据热门度查询所有车系名称在搜索文本框中显示
     *
     * @return
     */
    @RequestMapping("/select_all_car_series_name")
    List<Car_series> select_all_car_series_name();

    /**
     * 查询相关车系
     * 返回车系id  平均分  产商指导价  最高降幅  品牌名称 品牌图片
     * @param car_series_id
     * @return
     */
    @RequestMapping("/select_interrelated_series")
    List<Car_series> select_interrelated_series(@RequestParam int car_series_id);
}
